import pandas as pd
from matplotlib import pyplot as plt
import numpy as np

df_1 = pd.DataFrame(np.ones((2,4)), index=["A", "B"], columns=list("abcd"))
print("1---", df_1)

df_2 = pd.DataFrame(np.zeros((3,4)), index=["A", "B", "C"], columns=list("xyxz"))
print("2---", df_2)

print("3---", df_1.join(df_2)) # 行索引合并
print("4---", df_2.join(df_1))